﻿CREATE VIEW dbo.View_SEARCH_CALENDAR_PLAN
AS
SELECT        dbo.CALENDAR_PLAN.ID, dbo.CALENDAR_PLAN.NUMBER, dbo.CALENDAR_PLAN.START_DATE, dbo.CALENDAR_PLAN.END_DATE, 
                         dbo.CALENDAR_PLAN.CONTRACT_ID, dbo.CALENDAR_PLAN.PID, dbo.CONTRACT.NUMBER AS CONTRACT_NUMBER, 
                         dbo.CONTRACT.TYPE_DOC AS CONTRACT_TYPE_DOC, dbo.NSI_ORGANIZATION.SHORT_NAME AS NSI_ORG_NAME
FROM            dbo.NSI_ORGANIZATION RIGHT OUTER JOIN
                         dbo.CONTRACT ON dbo.NSI_ORGANIZATION.ID = dbo.CONTRACT.NSI_ORGANIZATION_ID RIGHT OUTER JOIN
                         dbo.CALENDAR_PLAN ON dbo.CONTRACT.ID = dbo.CALENDAR_PLAN.CONTRACT_ID